package com.yuexunit.finance.system.service;

import org.hibernate.criterion.DetachedCriteria;

import com.yuexunit.finance.system.entity.CostEntity;
import com.yuexunit.inject.annotation.Implements;
import com.yuexunit.page.PageCriteria;
import com.yuexunit.page.PageList;
import com.yuexunit.persist.PersistUtil;
import com.yuexunit.persist.annotation.Transactional;

/**
 * @author long
 */

@Implements(CosttypeSercice.class)
public class CosttypeSerciceImpl implements CosttypeSercice{

	/*@Override
	@Transactional
	public Long createCostAmount(CostEntity costEntity) {
		PersistUtil.insert(costEntity);
		return costEntity.getCharges_ID();
	}*/

	@Override
	@Transactional
	public void deleteCostAmount(Long getCharges_ID) {
		PersistUtil.delete(CostEntity.class, getCharges_ID);
	}

	@Override
	public PageList<CostEntity> inquireCostList(PageCriteria page) {
		DetachedCriteria criteria = DetachedCriteria.forClass(CostEntity.class);
		PageList<CostEntity> list = PersistUtil.get(criteria, page);
		return list;
	}

	@Override
	public void updateSystemParam(CostEntity CostEntity) {
	
		
	}

	@Override
	public Long createCostApp(CostEntity costEntity) {
		/*costEntity.setEnabled(Boolean.TRUE);
		costEntity.setCreateDateTime(DateUtil.now());
		costEntity.setUpdateDateTime(DateUtil.now());
		
		PersistUtil.insert(costEntity);
		return costEntity.getCharges_ID();*/
		PersistUtil.insert(costEntity);
		return costEntity.getCharges_ID();

	
	}
}
